package br.com.escola.aluno.facade;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import br.com.escola.aluno.dao.AlunoDAO;
import br.com.escola.aluno.dto.Aluno;

@Service
@Transactional
public class AlunoServiceFacadeImpl implements AlunoServiceFacade {
	
	//private Session session;
	@Autowired
	private AlunoDAO alunoDAO;
	
	/* (non-Javadoc)
	 * @see br.com.escola.aluno.facade.AlunoServiceFacade#adicionar(br.com.escola.aluno.dto.Aluno)
	 */
	public void adicionar(Aluno aluno) {
		alunoDAO.adicionarAluno(aluno);
	}
	
	/* (non-Javadoc)
	 * @see br.com.escola.aluno.facade.AlunoServiceFacade#remover(br.com.escola.aluno.dto.Aluno)
	 */
	public void remover(Aluno aluno){
		//alunoDAO.remover(aluno);
	}
	/* (non-Javadoc)
	 * @see br.com.escola.aluno.facade.AlunoServiceFacade#alterar(br.com.escola.aluno.dto.Aluno)
	 */
	public void alterar(Aluno aluno) {
		//alunoDAO.alterar(aluno);
	}

	/* (non-Javadoc)
	 * @see br.com.escola.aluno.facade.AlunoServiceFacade#buscaPorId(java.lang.Long)
	 */
	public Aluno buscaPorId(Long id) {
		return null;//alunoDAO.buscaPorId(id);
	}

	/* (non-Javadoc)
	 * @see br.com.escola.aluno.facade.AlunoServiceFacade#listar()
	 */
	public List<Aluno> listar() {
		return alunoDAO.listarAlunos();
		
	}
	
	
	/*public void adiciona(){
		EntityManager em = null;
		new HibernateUtil();
		session = HibernateUtil.getSession();
		DAO dao = new DAO(em, Aluno.class);
	}*/

	
}